﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Frame.Lib.Common;
using Frame.Lib.Utilities;

namespace Frame.Web.Common.Dict
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<EnumInfo> list = new List<EnumInfo>();

            string[] dicts = AppSetting.DictItem.Split(';');
            foreach (string str in dicts)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    Type type = Type.GetType(str);
                    if (type != null)
                    {
                        list.AddRange(ConvertUtil.ConvertEnum(type));
                    }
                }
            }

            if(list.Count>0)
            {
                this.List.Attributes["src"] = "List.aspx?ItemID=" + StrUtil.EncryptUrl(list.First().ID) + "&ItemName=" + list.First().Name;
            }
        }
    }
}
